Quickstart Expo
This guide will help you to implement the Group Link Mobile SDK on your application written in React Native using the Expo framework on the managed workflow.
Step 1 - Installing the Group Link Expo Library
Inside the root of your expo managed project, you need to install the Group Link Expo plugin as shown below.
- grouplink-sdk-expo-plugin
npm install @grouplinknetwork/grouplink-sdk-expo-plugin
Step 2 - Plugin Configuration
After you installed all the necessary libraries, you will need to set up the Group Link plugin, to do this you have to insert the rn-grouplinksdk-expo-plugin with the necessary options, like the token to initialize the plugin, you need to insert this inside the plugins array on your app.json, you can find this file at the root folder.
"plugins": [
[
"@grouplinknetwork/grouplink-sdk-expo-plugin",
{
"token": "GROUP_LINK_TOKEN"
}
]
]
After this you'll need to run:
npx expo prebuild
cd ios && pod install
Here are all the params you can call within our plugin:
- token - string - The Group Link Initialization token
iOS Specific Configs - You need to call the bluetooth and location permission
If the Expo version is 52 or lower, it will be necessary to install a library for iOS:
npm install @grouplinknetwork/rn-grouplink-sdk
import * as GroupLinkSDK from '@grouplinknetwork/rn-grouplink-sdk';
export default function App() {
useEffect(()=>{
// This function requires the Group Link Token of your organization.
GroupLinkSDK.startGrouplinkIOS("GROUP_LINK_TOKEN");
GroupLinkSDK.startBluetoothIOS();
GroupLinkSDK.startLocationIOS();
},[])
return (
<View style={styles.container}>
<Text>Thats a test app</Text>
</View>
);
}
Info.plist strings - THESE STRINGS WILL NOT OVERRIDE ALREADY SETTED STRINGS
- NSLocationAlwaysAndWhenInUseUsageDescription - string - The ios Core Location Always usage string inside info.plist - default is "We need location permission for a better user experience."
- NSLocationWhenInUseUsageDescription - string - The ios Core Location While in Use string inside info.plist - default is "We need location permission to provide a better user experience."
- NSBluetoothPeripheralUsageDescription - string - The ios Core Bluetooth Peripheral usage string inside info.plist - default is "We need Bluetooth permission to provide a better user experience."
- NSBluetoothAlwaysUsageDescription - string - The ios Core Bluetooth Usage string inside info.plist - default is "We need Bluetooth permission to provide a better user experience."